<html><!-- Created using the cpp_pretty_printer from the dlib C++ library.  See http://dlib.net for updates. --><head><title>dlib C++ Library - misc_api_shared.h</title></head><body bgcolor='white'><pre>
<font color='#009900'>// Copyright (C) 2014  Davis E. King (davis@dlib.net)
</font><font color='#009900'>// License: Boost Software License   See LICENSE.txt for the full license.
</font><font color='#0000FF'>#ifndef</font> DLIB_MISC_API_ShARED_H__
<font color='#0000FF'>#define</font> DLIB_MISC_API_ShARED_H__

<font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>string<font color='#5555FF'>&gt;</font>
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../noncopyable.h.html'>../noncopyable.h</a>"

<font color='#0000FF'>namespace</font> dlib
<b>{</b>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
    <font color='#0000FF'>class</font> <b><a name='locally_change_current_dir'></a>locally_change_current_dir</b> : noncopyable
    <b>{</b>
    <font color='#0000FF'>public</font>:
        <font color='#0000FF'>explicit</font> <b><a name='locally_change_current_dir'></a>locally_change_current_dir</b> <font face='Lucida Console'>(</font>
            <font color='#0000FF'>const</font> std::string<font color='#5555FF'>&amp;</font> new_dir
        <font face='Lucida Console'>)</font>
        <b>{</b>
            _old_dir <font color='#5555FF'>=</font> <font color='#BB00BB'>get_current_dir</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
            <font color='#BB00BB'>set_current_dir</font><font face='Lucida Console'>(</font>new_dir<font face='Lucida Console'>)</font>;
        <b>}</b>

        ~<b><a name='locally_change_current_dir'></a>locally_change_current_dir</b><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>
        <b>{</b>
            <font color='#BB00BB'>set_current_dir</font><font face='Lucida Console'>(</font>_old_dir<font face='Lucida Console'>)</font>;
        <b>}</b>

        <font color='#0000FF'>const</font> std::string<font color='#5555FF'>&amp;</font> <b><a name='old_dir'></a>old_dir</b> <font face='Lucida Console'>(</font>
        <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> 
        <b>{</b>
            <font color='#0000FF'>return</font> _old_dir;
        <b>}</b>

    <font color='#0000FF'>private</font>:
        std::string _old_dir;
    <b>}</b>;

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<b>}</b>

<font color='#0000FF'>#endif</font> <font color='#009900'>// DLIB_MISC_API_ShARED_H__
</font>

</pre></body></html>